package com.patrol.logisticsmanage.ui.base;

import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.alibaba.android.arouter.launcher.ARouter;
import com.patrol.logisticsmanage.R;
import com.patrol.logisticsmanage.common.ActivityManagerTool;


public class BaseActivity extends AppCompatActivity {
    protected Context mContext = this;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            this.getWindow().setStatusBarColor(getResources().getColor(R.color.colorPrimary));//设置状态栏颜色
            this.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);//实现状态栏图标和文字颜色为暗色
        }

        StatusBarUtils.setLightStatusBar(this,false);
        ARouter.getInstance().inject(this);
        ActivityManagerTool.getActivityManager().add(this);
    }



    public void close(View view) {
        finish();
    }

}
